package fr.thread.threadfactory.activity.intent;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import fr.thread.threadfactory.R;

/**
 * Activity is called by IntentsActivity just for a response
 * @author thread
 *
 */
public class CallBackActivity extends Activity {
	
	@Override
	public void onCreate(Bundle savedCurrentActivity){
		super.onCreate(savedCurrentActivity);
		
		setContentView(R.layout.callbackactivity);
	}
		
	/**
	 * This method is called if one button is clicked
	 * @param target clicked button
	 */
	public void onResults(View target){
		int targetedComp = target.getId();
		
		if (targetedComp == R.id.returnNo){
			setResult(RESULT_CANCELED); // if it's no you canceled
			finish();
		}else if (targetedComp == R.id.returnYes){
			setResult(RESULT_OK); // if it's Yes you valid this choice
			finish();
		}
	}
	
	
	

}
